package com.example.g7640.dto.common;

import lombok.*;

@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> {

    private Integer code;

    private String msg;

    private T data;

    private Integer pageNo;

    private Integer pageSize;

    private Integer totalNum;


    public Integer getTotalPage() {
        Integer pageNum = getTotalNum() / getPageSize();
        return (0 == getTotalNum() % getPageSize()) ? pageNum : pageNum + 1;
    }
}
